package cloud.daodao.storm.demo.service;

import cloud.daodao.storm.common.demo.model.Cat;
import cloud.daodao.storm.common.demo.model.Dog;
import cloud.daodao.storm.demo.config.AppConfig;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author DaoDao
 */
@Slf4j
@Service
public class DemoService {

    @Resource
    private AppConfig appConfig;

    public Dog demo(Cat cat) {

        log.info("slogan : {}", appConfig.getSlogan());

        String name = cat.getName();
        name = new StringBuilder(name).reverse().toString();

        Dog dog = new Dog();
        dog.setName(name);

        return dog;
    }

}
